<?php
	$username = $_POST['username'];
	$password1 = $_POST['password1'];
	$fname = $_POST['fname'];
	$lname = $_POST['lname'];
	$dob = $_POST['dob'];
	$title = $_POST['title'];
	$email = $_POST['email'];
	$mobno = $_POST['mobno'];
	$homeno = $_POST['homeno'];
	$workno = $_POST['workno'];
	
	$result = addNewUser($username, $password1, $fname, $lname, $dob, $title, $email, $mobno, $homeno, $workno);
	
	if ($result == 1) {
		echo "<p>Thankyou for registering for Flatshare! Please click <a href=\"index.php\">here</a> to return home!</p>";
	}
	else {
		echo "<p>The username or email address you have selected is already in use. Please try again</p>";
		include("flatshare_php/register_form.php");
	}
?>